//
//  ByeNowTableViewCell.m
//  TodatPlay
//
//  Created by dllo on 16/9/6.
//  Copyright © 2016年 DM.C. All rights reserved.
//

#import "ByeNowTableViewCell.h"
#import "SDAutoLayout.h"
@implementation ByeNowTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self contents];
    }
    return self;
}
- (void)contents {
    UIImageView *carImageView = [UIImageView new];
    UIImageView *wifiImageView = [UIImageView new];
    self.is_parking_space = [UILabel new];
    self.is_wifi = [UILabel new];
    self.for_tickets_desc = [UILabel new];
    self.is_reserve = [UILabel new];
    self.age_limit = [UILabel new];
    self.support_hotline = [UILabel new];
    
    _is_parking_space.font = [UIFont systemFontOfSize:14];
    _is_wifi.font = [UIFont systemFontOfSize:14];
    _for_tickets_desc.font = [UIFont systemFontOfSize:14];
    _is_reserve.font = [UIFont systemFontOfSize:14];
    _age_limit.font = [UIFont systemFontOfSize:14];
    _support_hotline.font = [UIFont systemFontOfSize:14];
    _support_hotline.textColor = [UIColor redColor];
    carImageView.image = [UIImage imageNamed:@"car"];
    wifiImageView.image = [UIImage imageNamed:@"wifi"];
    
    _is_parking_space.text = @"有停车场";
    _is_wifi.text = @"无免费wifi";
    _for_tickets_desc.text = @"需要换票, 若你的订单状态为审核通过, 恭喜你中奖了, 神马君回电话联系你取票事宜";
    _is_reserve.text = @"无需预约";
    _age_limit.text = @"无年龄限制";
    _support_hotline.text = @"1564465468";
    
    [self.contentView addSubview:_is_parking_space];
    [self.contentView addSubview:_is_wifi];
    [self.contentView addSubview:_for_tickets_desc];
    [self.contentView addSubview:_is_reserve];
    [self.contentView addSubview:_age_limit];
    [self.contentView addSubview:_support_hotline];
    [self.contentView addSubview:carImageView];
    [self.contentView addSubview:wifiImageView];
    
    carImageView.layer.cornerRadius = 7.5;
    carImageView.layer.masksToBounds = YES;
    carImageView.layer.borderColor = [UIColor blackColor].CGColor;
    carImageView.layer.borderWidth = 0.5;
    
    wifiImageView.layer.cornerRadius = 7.5;
    wifiImageView.layer.masksToBounds = YES;
    wifiImageView.layer.borderColor = [UIColor blackColor].CGColor;
    wifiImageView.layer.borderWidth = 0.5;
    
    carImageView.sd_layout
    .topSpaceToView(self.contentView, 10)
    .leftSpaceToView(self.contentView, 10)
    .widthIs(15)
    .autoHeightRatio(1);
    
    _is_parking_space.sd_layout
    .leftSpaceToView(carImageView, 5)
    .topSpaceToView(self.contentView, 8)
    .widthIs(60)
    .heightIs(20);
    
    wifiImageView.sd_layout
    .leftSpaceToView(_is_parking_space, 10)
    .centerYEqualToView(carImageView)
    .widthIs(15)
    .autoHeightRatio(1);
    
    _is_wifi.sd_layout
    .leftSpaceToView(wifiImageView, 5)
    .topSpaceToView(self.contentView, 8)
    .widthIs(70)
    .heightIs(20);
    
    _for_tickets_desc.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(carImageView, 20)
    .rightSpaceToView(self.contentView, 15)
    .autoHeightRatio(0);
    
    _is_reserve.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(_for_tickets_desc, 10)
    .rightSpaceToView(self.contentView, 15)
    .autoHeightRatio(0);
    
    _age_limit.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(_is_reserve, 10)
    .rightSpaceToView(self.contentView, 15)
    .autoHeightRatio(0);
    
    _support_hotline.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(_age_limit, 10)
    .rightSpaceToView(self.contentView, 15)
    .autoHeightRatio(0);
    
    [self setupAutoHeightWithBottomView:_support_hotline bottomMargin:10];
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
